package com.atguigu.test;

import com.atguigu.aop.MathCalculator;
import com.atguigu.config.MainConfigAop;
import com.atguigu.config.MainConfigOgLifeCycle;
import org.junit.Test;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import java.util.Arrays;

public class IOCTest_Aop {
    AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext(MainConfigAop.class);

    @Test
    public void test() {
        //获取容器中对象
        MathCalculator bean = applicationContext.getBean(MathCalculator.class);
        System.out.println(bean);
//        String[] beanNamesForType = applicationContext.getBeanNamesForType(MathCalculator.class);
//        System.out.println(Arrays.asList(beanNamesForType));
        bean.div(4, 2);
    }
}
